-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Use normalizer context constants everywhere #12582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use normalizer context constants everywhere #12582
Conversation
Hi @l-vo 👋 , first of all thanks for your contribution. Cheers 🙏 |
Hi @OskarStark :) Some examples used context constants and some others not. I thought it was an oversight for the examples that didn't use constants. Furthermore I think using constants in the doc allows to advise the developpers that context constants exist and that they should use them instead of magic strings. |
Thank you for your feedback! |
@OskarStark No problem ! Thank you for your feedback too :) |
I'd say we should do this ... but it's sad that the constants are so long and ugly 😢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the "magic strings" here as I find it easier to read, but either is fine so 👍
@javiereguiluz this should go into 3.4, right? |
This PR was merged into the 4.3 branch. Discussion ---------- Use normalizer context constants everywhere Commits ------- 70f84af Use normalizer context constants everywhere
Thanks @l-vo! I agree with everything that's said here: It's sad that these constants aren't the nicest constants, but it seems to be commonly accepted that constants are favored over "magic strings". @OskarStark you're correct that this in theory applies to 3.4 as well. I merged it in 4.3 however, because there were quite some changes in the options between 3.x and 4.x (DEEP_OBJECT stuff). This isn't a major thing, so only fixing it in the latest branches isn't a huge deal I think (and fixing it in 3.4 and 4.3 takes a some of time). |
No description provided.